import network from '@/utils/network'
import baseUrl from './baseUrl'
const BASE_URL = baseUrl + '/Api'

export default {
  async getPageList(params: any) {
    return await network.request({
      url: BASE_URL + '/GetPageList',
      method: 'get',
      params
    })
  },
  async getCommonPageList(params: any) {
    return await network.request({
      url: BASE_URL + '/GetCommonPageList',
      method: 'get',
      params
    })
  },
  async save(data: any) {
    return await network.request({
      url: BASE_URL + '/Save',
      method: 'post',
      data
    })
  },
  async deleteById(id: any) {
    return await network.request({
      url: BASE_URL + '/deleteById',
      method: 'post',
      data: id
    })
  },
  async checkExistByName(name: string, id: any) {
    return await network.request({
      url: BASE_URL + '/CheckExistByName',
      method: 'get',
      params: {
        name, id
      }
    })
  },
  async checkExistByPath(path: string, id: any) {
    return network.request({
      url: BASE_URL + '/CheckExistByPath',
      method: 'get',
      params: {
        path, id
      }
    })
  }
}